package com.liao.servlet;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.liao.entity.PatientAggStat;
import com.liao.service.PatientAggStatService;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import java.io.IOException;
import java.util.List;

@WebServlet("/patientAgg")
public class PatientAggStatServlet extends HttpServlet {

    @Override
    public void service(ServletRequest req, ServletResponse response) throws ServletException, IOException {
        PatientAggStatService service=new PatientAggStatService();
        String json=service.findAll();
        //2.响应结果
        response.setContentType("application/json;charset=utf-8");
        response.getWriter().write(json);
    }

}
/*json数据

[
    {
        "taskId":"1",
        "visitCount":5,
        "visit_day_1d_3d_ratio":5,
        "visit_day_4d_6d_ratio":7,
        "visit_day_7d_9d_ratio":10,
        "visit_day_10d_30d_ratio":45,
        "visit_day_30d_60d_ratio":78,
        "visit_day_60d_ratio":74,
        "step_day_1_3_ratio":12,
        "step_day_4_6_ratio":3,
        "step_day_7_9_ratio":99,
        "step_day_10_30_ratio":5,
        "step_day_30_ratio":6,
        "createTime":1626692674000
    }
]

 */